<template>
  <div>
    <div class="v-content" v-for="item in data" :key="item.index" @click="gotoitem()">
      <div class="v-item">
        <div class="v-img">
          <img src="../../images/folder-icon.png" alt="">
        </div>
        <div class="v-describe">
          <p><span>{{item.filename}}</span><i></i><i></i></p>
          <p><span>{{item.path}}</span>|<span>{{item.time}}</span>|<span>{{item.size}}</span></p>
        </div>
        <div class="v-option" @click.stop="gotooption()">
          <mu-icon-menu icon="more_vert" @change="handleChange" :value="value" :anchorOrigin="rightBottom" :targetOrigin="rightBottom">
            <mu-menu-item value="1" title="Refresh" />
            <mu-menu-item value="2" title="Send feedback" />
            <mu-menu-item value="3" title="Settings" />
            <mu-menu-item value="4" title="Help" />
            <mu-menu-item value="5" title="Sign out" />
          </mu-icon-menu>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    data: [Object]
  },
  data() {
    return {
      rightBottom: {
        horizontal: 'right',
        vertical: 'bottom'
      },
      value: '3'
    };
  },
  methods: {
    handleChange(val) {
      this.value = val;
    },
    gotooption() {
      console.log(2);
    },
    gotoitem() {
      this.$emit('gotoitem');
    }
  }
};
</script>

<style lang="less">
.v-content {
  padding: 0 23px;
  overflow: hidden;
  margin: 10px auto;
  border-bottom: 1px solid #f8f8f8;
  .v-item {
    overflow: hidden;
    margin-bottom: 10px;
    .v-img {
      float: left;
      width: 2.5rem;
      height: 2.5rem; // margin-right: 10px;
      img {
        width: 100%;
      }
    }
    .v-describe {
      overflow: hidden;
      float: left;
      width: 77%;
      p {
        &:nth-child(1) {
          font-size: 1rem;
          color: #333333;
        }
        &:nth-child(2) {
          font-size: 0.7rem;
          color: #9E9E9E;
        }
        span {
          margin-left: 5px;
          margin-right: 5px;
        }
      }
    }
    .v-option {
      float: right;
      margin-top: 8px;
      .mu-icon-button {
        width: 30px;
        height: 30px;
        padding: 3px;
        .mu-icon {
          color: #cbcbcb;
        }
      }
    }
  }
}
</style>
